package team.pwy.controller;


import com.google.gson.Gson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import team.pwy.service.MovieIndexService;
import team.pwy.service.TypeIndexService;
import team.pwy.vo.TypeDTO;

import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("typeIndex")
public class TypeESController {

    @Autowired
    private TypeIndexService typeIndexService;
    @GetMapping()
    public String findByType(String type) throws IOException {
        return new Gson().toJson(typeIndexService.findByType(type));
    }
}
